<template>
    <!-- 标题区域 -->
    <van-nav-bar title="商品列表" fixed></van-nav-bar>
    <div style="height: 45px;"></div>
    <!-- 渲染区域 -->
    <div v-for="item in goodsData">
        <router-link :to="{name:'detail',params:{goods_id:item.goods_id}}">
              <van-card  :price="item.goods_price"  :title="item.goods_name"  :thumb=" item.goods_small_logo ? item.goods_small_logo :  'https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg'" />
        </router-link>
      
    </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRoute } from 'vue-router'
const route = useRoute()
console.log(route.params.query)
import { GoodsApi } from '@/api/api'
let goodsData = ref([])
GoodsApi(route.params.query).then(res => {
    console.log('商品列表', res)
    goodsData.value = res.data.message.goods
})
</script>

<style lang="scss" scoped></style>